{% load news %}
{% load urls %}
{% load comments %}

<div class="story" {% if record.category.url == 'photos' %}itemscope itemtype="schema.org/ImageObject"{% endif %}>
    <div class="header">
        <span class="orange">{{ record.category.title }}</span>
        &rarr;
        <span class="green"><a href="{% url apps.news.views.base.record record.category.url record.pk record.url %}" title="{{ record.title }}">
            {% if record.category.url == 'photos' %}
                {{ record.title|schema_name|safe }}
            {% else %}
                {{ record.title }}
            {% endif %}
        </a></span>
    </div>
    <div class="options">
        <ul class="plus-block">
            <li class="icon-author" title="Автор">{{ record.author.username }}</li>
            <li class="icon-date" title="Дата публикации"><a rel="nofollow" href="{% url apps.news.views.base.calendar record.publish_date.year record.publish_date.month record.publish_date.day %}" title="Материалы за {{ record.publish_date|date:"d E Y" }}">{{ record.publish_date|date:"d E Y" }}</a></li>
            <li class="icon-views" title="Просмотров">{{ record.views }}</li>
            <li class="icon-comments" title="Комментариев">{% comments_count record.pk %}</li>
            <li id="rating-news-{{ record.pk }}" class="right rating">
                <img class="rating-button left" src="{{ STATIC_URL }}images/icon-down.gif" title="Уменьшить рейтинг: {{ record.title }}" alt="Уменьшить рейтинг: {{ record.title }}" onclick="updateNewRecordRating({{ record.pk }}, 1); return false;">
                <span class="green value">{{ record.rating }}</span>
                <img class="rating-button left" src="{{ STATIC_URL }}images/icon-up.gif" title="Увеличить рейтинг: {{ record.title }}" alt="Уменьшить рейтинг: {{ record.title }}" onclick="updateNewRecordRating({{ record.pk }}, 0); return false;">
            </li>
        </ul>
    </div>
    <div class="cut">
        {% if record.category.url == 'photos' %}
            {{ record.short_story|schema|safe }}
        {% else %}
            {{ record.short_story|safe }}
        {% endif %}
    </div>
    <div class="options">
        <ul class="plus-block">
            <li class="icon-fullstory right"><a href="{% url apps.news.views.base.record record.category.url record.pk record.url %}" title="{{ record.title }}">Читать далее...</a></li>
            {% if user.is_staff %}
                <li class="right"><a href="{% url apps.news.views.admin.edit record.pk %}" title="Редактировать: {{ record.title }}" target="_blank">Редактировать</a></li>
            {% endif %}
        </ul>
    </div>
</div>
